Skip to content

[ES|QL] Fix VerificationException when in subquery is used together with QSTR/KQL#155010

Draft
fang-xing-esql wants to merge 2 commits into
elastic:mainfrom
fang-xing-esql:in-subquery-with-qstr-kql
Draft

[ES|QL] Fix VerificationException when in subquery is used together with QSTR/KQL#155010
fang-xing-esql wants to merge 2 commits into
elastic:mainfrom
fang-xing-esql:in-subquery-with-qstr-kql

Conversation

@fang-xing-esql

Copy link
Copy Markdown
Member

Fixes: #154758

Fixes two bugs that caused QSTR/KQL combined with (NOT) IN subqueries to fail with a VerificationException.

Bug 1 — FullTextFunction.checkCommandsBeforeExpression used plan.forEachDown to walk the logical plan, which descended into the RHS of an AbstractSubqueryJoin, it should only look into the LHS of an AbstractSubqueryJoin, as the RHS is a non-correlated query, and it should not affect the FTF in its parent query. Also the synthetic attributes created by MarkJoin should not block QSTR/KQL.

Bug 2 — PushDownAndCombineFilters didn't push filter past AbstractSubqueryJoin.

A new WHERE_IN_SUBQUERY_WITH_QSTR_KQL_FIX capability gates all new CSV-spec tests, which cover the AND/OR × IN/NOT IN × QSTR/KQL matrix including the hash-join execution path with multi-valued fields.

@elasticsearchmachine

Copy link
Copy Markdown
Collaborator

Hi @fang-xing-esql, I've created a changelog YAML for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ES|QL] InSubquery used together with QSTR/KQL may throw VerificationException

2 participants